Skip to content

Change the logic of NewVersionTest#19

Open
PenghaiZhang wants to merge 2 commits intomasterfrom
feature/new_version_alert_test
Open

Change the logic of NewVersionTest#19
PenghaiZhang wants to merge 2 commits intomasterfrom
feature/new_version_alert_test

Conversation

@PenghaiZhang
Copy link

  • handling the new alert when creating a new version of an

    item that is in moderation

  • refactoring code to reduce duplicated code

* handling the new alert when creating a new version of an

  item that is in moderation

* refactoring code to reduce duplicated code
Copy link
Contributor

@SammyIsConfused SammyIsConfused left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just a few minor changes. 👍

itemList = adminPage.results();
// Login as SimpleModerator and moderate the new version of this item at the first step.
logon(FIRST_MODERATOR_USERNAME, BACKTICK_PASSWORD);
doModeration(FIRST_MODERATOR_USERNAME, BACKTICK_PASSWORD, "moderation step 1", itemFullName2,false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe create a constant for "moderation step 1" string, as it is used more than once. Probably step 2 as well, for consistency.

@TestInstitution("workflow")
public class NewVersionTest extends AbstractCleanupTest
{
private static final String BACKTICK_PASSWORD = "``````";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these are all public static final String, the whitespaces between each line should be removed.

String itemFullName2 = itemFullName + " 2";
wizard.editbox(1, itemFullName);
wizard.save().submit();
saveItem(wizard,1,itemFullName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be space between the parameters.

Copy link
Member

@edalex-ian edalex-ian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of tweaks, then we should be done. 👍

}

private void doModeration(String username, String password, String stepName, String itemFullName, Boolean lastModeration) {
TaskListPage taskListPage = new TaskListPage(context).load();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

username and password are unused. Remove.

// Login as SimpleModerator and moderate the new version of this item at the first step.
logon(FIRST_MODERATOR_USERNAME, BACKTICK_PASSWORD);
doModeration(FIRST_MODERATOR_USERNAME, BACKTICK_PASSWORD, STEP_NAME_ONE, itemFullName2,false);
// After moderation, check that the item has gone life after the first moderation step
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo:

has gone life

should be

has gone live

ModerationView tasksTab = modResults.moderate(itemFullName);
tasksTab.assignToMe();
tasksTab.accept();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this if/else the braces should follow the statement.

Shame we don't have formatting here yet, but we will once we merge this repo in.

@PenghaiZhang PenghaiZhang force-pushed the feature/new_version_alert_test branch from ce8d91b to e7d534d Compare February 26, 2019 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants